<template>
	<div>
		<nut-popup
			lock-scroll
			position="bottom"
			:style="{ borderRadius: '10px 10px 0 0 ', padding: 0 }"
			v-model:visible="isVisible"
			@clickOverlay="onClose"
		>
			<div class="addModel">
				<div class="flex flexBetween padding">
					<div class="address">编辑快递</div>
					<nut-icon name="close" class="close" @click="onClose"></nut-icon>
				</div>

					<nut-form :model-value="formData" ref="ruleForm" :rules="rules" style="height:20vh">
						<nut-form-item label="物流单号" prop="express_num">
							<nut-input
								class="nut-input-text"
								v-model="formData.express_num"
								max-length="25"
								placeholder="请输入快递单号"
							/>
						</nut-form-item>
						<nut-form-item label="物流公司" prop="express_company">
							<nut-input
								class="nut-input-text"
								v-model="formData.express_company"
								placeholder="请输入快递公司"
								max-length="10"
								type="text"
							/>
						</nut-form-item>
					</nut-form>
				 
				<div class="footer">
					<nut-divider
						style="color: #eeeeee; margin: 0px 0 10px 0 !important"
					/>
					<div class="footer-item">
						<nut-button
							type="primary"
							block
							color="linear-gradient(to right, #3EBD33, #9FDF4F)"
						    @click="handSubmit"
							>确定</nut-button
						>
					</div>
				</div>
			</div>
		</nut-popup>
	</div>
</template>

<script lang="ts" setup>
import { reactive, ref } from 'vue'
import { Toast } from '@nutui/nutui'
import { EditType } from '@/type/BaseEnum'
import useAddRessModel from '@/composable/manage/useAddressModel'
import useInstance from '@/hooks/useInstance'
import useKuidi from '@/composable/manage/useKuidi'
const { formData, submit, ruleForm, rules,rowData,isVisible,getData } = useKuidi()
const { global } = useInstance()
const emits = defineEmits(['saveEms'])
const onClose = () => {
	isVisible.value = false
}

const show = (type: string, row: any) => {
	isVisible.value = true
	rowData.value = row;
	getData();
}
const handSubmit=()=>{
  submit();
 
	emits("saveEms",{
		formData:formData,
		rowData:rowData.value
	})
}
defineExpose({
	show
})
</script>
<style scoped lang="scss">
.addModel {
	border-radius: 20px 20px 0 0 ;
	padding: 36px 30px;
}
.address {
	font-size: 32px;
	font-weight: bold;
	color: #000;
}
.close {
	font-size: 26px !important;
	font-weight: bold;
}
:deep(.nut-input .input-text, .nut-input__text--readonly) {
	color: #666 !important;
}
</style>